
var Action = require("../apiaction");
//返回 list 的 page rows
//
exports.get_list_page_size_param = function(req,param){

    //var param = {page: 1, rows: 10};
    var page = req.param('page');
    var rows = req.param('rows');
    if (!page) {
        param.page = 1;

    } else {
        param.page = page;

    }


    if (!rows) {
        param.rows = 10;

    } else {
        param.rows = rows;

    }


    return param;
}

//增加参数
exports.addParam = function(req,param,key){




}

//获取菜单信息
exports.getMenuList=function(req,res,func){

    var params ={session_id: req.cookies.sessionid};
    Action.send(req, res,"/adminUser/getmenulist",params,function(res,data) {


        //console.log("3123123123131123131");
        console.log(data);
        func(JSON.parse(data).data)
        //res.status(200).json(JSON.parse(data));
    });



}

//返回公用参数
exports.returnCommonParam=function(req,res){

    var params ={cookie: req.cookies};


    return params;



}

exports.mergeParam=function(req,data,param){

    var design1 = req.param(param);

    if(design1 == "")
        return data;

    if(design1 == "/images/empty.png")
        return data;


    if(data == "")
        data = data+design1;
    else
        data = data+","+design1;

    return data;







}

